/*
 *  lobby_window.h
 */

#ifndef LOBBY_WINDOW_H
#define LOBBY_WINDOW_H

#include <gtkmm.h>
#include <gtkmm/window.h>
#include <vector>
#include "client_app.h"
#include "client_window.h"
#include "game_info.h"
#include "game_record.h"
#include "joingame_window.h"
#include "newgame_window.h"


class LobbyWindow : public ClientWindow {
public:
	LobbyWindow(BaseObjectType* object,
			    const Glib::RefPtr<Gtk::Builder>& builder);
    ~LobbyWindow();
    void setApp(ClientApp* app);
    virtual void notifyGameInfoUpdate(ClientApp* app);
    virtual void notifyGameJoinOk(ClientApp* app);
protected:
	Gtk::Button* btnJoinGame;
	Gtk::Button* btnNewGame;
	Gtk::Button* btnRefresh;
	Gtk::TreeView* tvGames;
	Glib::RefPtr<Gtk::ListStore> list_store;
	GameRecord game_record;
	Gtk::Image* img;
	NewGameWindow* winNewGame;
	JoinGameWindow* winJoinGame;
	std::vector<GameInfo> games;
	void onJoinGame();
	void onNewGame();
	void onRefresh();
	void changeImage();
private:
	void createGameTreeView(const Glib::RefPtr<Gtk::Builder>& builder);
};

#endif //LOBBY_WINDOW_H

//{+}

